<?php
/*
 * Created on 22.12.2005
 *
 */

// TODO add target attribute, if validate name is required
class ajax_cronHandler
{
    
    var $name = null;

    function startElement (& $sender, $attrs)
    {
        $sender->appendCode('$out->write(\'var \'.'.$attrs['name'].'.\';dojo.addOnLoad(function () {\'.'.$attrs['name'].'.\' = new CronJob(\'.'.$attrs['delay'].'.\', \'.'.($attrs['startnow']?$attrs['startnow']:"'false'").'.\', function () {\'); 
'."\n");
    }

    function endElement (& $sender)
    {
        $sender->appendCode('$out->write(\'})});\');'."\n");
    }

}

?>